<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false"%>
<html>
<head>
    <title>文件列表</title>
</head>
<body>
    <%--文件显示--%>
    <h1>文件列表</h1>
    <%
        String flag = "";
        Object object = session.getAttribute("flag");
        if(object != null) {
            flag = object.toString();
        }
        if(flag.equals("login_success")) {
    %>
    <a href="<%= request.getContextPath() %>/logout">退出</a>
    <%
    } else {
    %>
    <a href="<%= request.getContextPath() %>/login.jsp">登录</a><br/>
    <%
        }
    %>

    <br>
    <a href="upload.jsp">上传文件</a>
    <br>
    <a href="<%= request.getContextPath() %>/index">查看文件</a>

    <br>

    <c:forEach items="${list}" var="f">
        <a href="download?name=${f}">${f}</a><br>
    </c:forEach>
</body>
</html>
